<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title><%= title %></title>
	</head>
	<body>
		<div class="row">
			<input type="text" class="name"/>
			<input type="password" class="password" />
			<div class="btn">登录</div>
		</div>
	</body>
	<script type="text/javascript" src="/webSite/js/jquery-2.1.0.js" ></script>
	<script>
		$(function(){
			$(".btn").click(function(){
				var data = {
					name : $(".name").val(),
					password : $(".password").val()
				};
				$.post("/login" , data , function(data){
					console.log(data);
					if(data.state == "ok"){
						alert("登录成功");
						window.location.href = "/";
					}else{
						alert(data.message);
					};
				},"JSON");
			});
		})
	</script>
</html>
